'use strict';

const chapter = require('../models/chapter');

/** @type {import('sequelize-cli').Migration} */
module.exports = {
  async up(queryInterface, Sequelize) {
    /**
     * Add seed commands here.
     *
     * Example:
     * await queryInterface.bulkInsert('People', [{
     *   name: 'John Doe',
     *   isBetaMember: false
     * }], {});
     */
    await queryInterface.bulkInsert('Courses', [
      {
        categoryId: 1,
        userId: 1,
        image: 'https://example.com/course-image.jpg',
        name: 'css 入门',
        recommended: true,
        introductory: true,
        chaptersCount: 1,
        createdAt: new Date(),
        updatedAt: new Date(),
      },
      {
        categoryId: 2,
        userId: 1,
        image: 'https://example.com/course-image.jpg',
        name: 'Node.js 项目实战（2024版）',
        chaptersCount: 2,
        recommended: true,
        introductory: false,
        createdAt: new Date(),
        updatedAt: new Date(),
      },
    ]);
  },

  async down(queryInterface, Sequelize) {
    /**
     * Add commands to revert seed here.
     *
     * Example:
     * await queryInterface.bulkDelete('People', null, {});
     */
    await queryInterface.bulkDelete('Courses', null, {});
  },
};
